package cn.vshare.service.impl;

import cn.vshare.dao.FansDao;
import cn.vshare.entity.User;
import cn.vshare.service.FansService;
import cn.vshare.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class FansServiceImpl implements FansService {
    @Autowired
    private FansDao fansDao;

    @Override
    public void addFans(Map map) {
        map.put("focusedDate",DateUtil.getCurrDate());
        fansDao.addFans(map);
    }

    @Override
    public void delFans(Map map) {
        fansDao.delFans(map);
    }

    @Override
    public List<User> queryMyFans(String myId) {
        return fansDao.queryMyFans(myId);
    }

    @Override
    public int isExistFans(String myId, String fansId) {
        return fansDao.isExistFans(myId,fansId);
    }

    @Override
    public int queryFocusCount(String userId) {
        return fansDao.queryFocusCount(userId);
    }

    @Override
    public int queryFansCount(String userId) {
        return fansDao.queryFansCount(userId);
    }
}
